package com.yiyuplatform.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @Description
 * @Author dalong
 * @Date 2021-11-08
 */

@Getter
@Setter
@ToString
@NoArgsConstructor
@EqualsAndHashCode
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true)
@Entity
@Table(name = "bbs_t_post_main")
public class BbsTPostMain implements Serializable {
    private static final long serialVersionUID = 3988178045669937320L;

    /**
     * 主贴uuid,插入时使用uuid()生成id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "P_ID")
    private String pId;

    /**
     * 帖子内容,前端另写代码限制长度
     */
    @Column(name = "P_TITLE")
    private String pTitle;

    /**
     * 帖子发表时间
     */
    @Column(name = "P_PUBTIME")
    private Timestamp pPubtime;

    /**
     * 帖子更新时间（最后一次跟帖时间）
     */
    @Column(name = "P_UPDATETIME")
    private Timestamp pUpdatetime;

    /**
     * 贴主uuid,外键
     */
    @Column(name = "P_MASTERID")
    private String pMasterid;

    /**
     * 是否为精华帖
     */
    @Column(name = "P_IFGOOD")
    private Integer pIfgood;

    /**
     * 是否置顶
     */
    @Column(name = "P_IFTOP")
    private Integer pIftop;

    /**
     * 浏览量
     */
    @Column(name = "P_READ_NUM")
    private Long pReadNum;

}
